<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function sky(i){
            //结束日期
            var date = new Date();
            var end = date.toLocaleDateString();
            if(i == 1){
                date.setDate(-3);
            }else{
                date.setDate(-7);
            }
            var start = date.toLocaleDateString();
            alert("开始日期：" + start + "\n" + "结束日期：" + end);
        }
    </script>
</head>
<body>
    <input type="radio" name="deadline" onclick="sky(1)">三天&nbsp&nbsp
    <input type="radio" name="deadline" onclick="sky(2)">一周
</body>
</html>